package com.jstorm.count.controller.signal;

import com.jstorm.count.pojo.Result;
import com.jstorm.count.service.signal.SignalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ProjectName: springboot-mybatis
 * @Package: com.jstorm.count.controller.network
 * @ClassName: CommonroadController
 * @Description:
 * @Author: Mr_hu
 * @CreateDate: 2018/12/29 10:08
 * ***********************************************************
 * @UpdateUser: Mr_hu
 * @UpdateDate: 2018/12/29 10:08
 * @UpdateRemark: The modified content
 * @Version: 1.0
 * ***********************************************************
 * Copyright: Copyright (c) 2018
 **/
@Controller
@ResponseBody
@RequestMapping("/signal/*")
public class SignalController {

    @Autowired
    private SignalService signalService;

    /**
     * 共路信令数量统计
     * @return
     */
    @RequestMapping("/signal-count")
    public Result SignalCount(){
        try {
            return Result.isOk().data(signalService.selectNumber());
        } catch (Exception e) {
            return Result.isFail(e);
        }
    }


    /**
     * 共路信令数量统计
     * @return
     */
    @RequestMapping("/signal-total")
    public Result SignalTotal(){
        try {
            return Result.isOk().data(signalService.selectTotal());
        } catch (Exception e) {
            return Result.isFail(e);
        }
    }

}
